public class Text4 {
    //11.称最多水的容器
    public int maxArea(int[] height) {
        int left = 0, right = height.length - 1;
        int ret = 0;
        while(left < right){
            int v = Math.min(height[left],height[right]) * (right - left);
            ret = Math.max(v,ret);
            if(height[left]<height[right]){
                left++;
            } else {
                right--;
            }
        }

        return ret;
    }
}
